<template>
	<view class="components-home">
		<!-- <view class="my-tab-box">
			<my-tab ref="myTab" :list="tabList" @change="changeTab" :currentIndex="tabIndex" name="title"></my-tab>
		</view> -->
		
		<view>
			<my-list ref="myList"
				:api="productList" :params="params" :transformRequestData="transformRequestData">>
				<template v-slot:card="{list}">
					<view class="product-list-wrapper">
						<!-- <card :bottom="0" :list="list" :isList="false"
							:style="{paddingTop: 10 + 'rpx' }"></card> -->
						
						<view style="padding: 30rpx;height: 200rpx;
						border: 2rpx solid #ccc;box-shadow: 0 0 0 0  rgba(4,4,21, 0.1);
						border-radius: 10rpx;
						margin-bottom: 30rpx;
						"
							v-for="(item,index) in list"
						>
							<view style="display: flex;justify-content:space-between;align-items:center">
								<text>
									{{item.createtime}}
								</text>
								
								<text style="background: #A4ADB3;padding: 20rpx;border-radius:10rpx;color: #fff;">
									{{item.status}}
								</text>
							</view>
							
							<view style="margin-top: 30rpx;display: flex;justify-content:space-between;align-items:center">
								<text style="font-size: 40rpx;font-weight: bold;">
									￥ {{item.money}} 
								</text>
								<text>
									查看详情
								</text>
							</view>
						</view>
							
					</view>
				</template>
			</my-list>
		</view>
		
		
	</view>
</template>

<script>
	import request from '@/common/request.js';
	import Card from '@/components/mycard/log.vue';
	export default {
		components: {
			Card
		},
		data() {
			return {
				cardCur: 0,
				bannerList: [
				],
				tabList: [
					{
						type:1,
						title:"直购"
					},
					{
						type:2,
						title:"同人"
					},
					{
						type:3,
						title:"水印"
					}
				],
				tabIndex:0,
				modalName: null, //会员弹窗
			}
		},
		computed:{
			params() {
				return {
					tabId: this.tabIndex,
					limit:10
				};
			}
		},
		onShow() {

		},
		mounted() {

		},
		onPullDownRefresh() {
			this.$refs.myList.onRefresh();
		},
		onReachBottom() {
			this.$refs.myList.onMore();
		},
		methods: {
			search(e){
				console.log(e);
			},
			changeTab(e) {
				this.tabIndex = e.index;
			},
			transformRequestData(data) {
				console.log('data111', data.data.data)
				return data.data.data.data;
			},
			productList(value) {
				console.log('111',value)
				let opts = {
					url: 'api/user/getRechargeLog',
					method: 'get'
				};
				const result =  request.httpTokenRequest(opts, value);
				return result;
			
			},
		}
	}
</script>

<style lang="scss" scoped>
	page{
		padding: 30rpx;;
	}
</style>
